<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<script type="text/javascript">
	function deleteRquestGoods(id,demandID){
		if(confirm("确定删除所选吗?")){
		$.post("/oversea/ajaxbutton", {"op": "delpurlist","id":id,"demandID":demandID},
			 function(data){
				window.location.reload();
			},"json");
		}
	}
</script>
<title>查看需求</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">查看需求</h1>
      <span class="pagedesc"></span>
      <div class="menulist">
        <ul class="profile_summary">
          <li class="current"></li>
        </ul>
      </div>
    </div>
    <!--pageheader-->
    
    <div id="contentwrapper" class="contentwrapper">
      <div id="basicform" class="subcontent">
        <form class="stdform stdform2"  id="theFrom" method="post" action="/oversea/savecompare">
        
        	 <div class="contenttitle2">
            <h3>基本信息</h3>
          </div>
             <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
          
            <thead>
              <tr>
                <th class="head1">申请编号</th>
                <th class="head1">申请日期</th>
                <th class="head1">申请状态</th>
                <th class="head1">申请人</th>
                <th class="head1">店铺</th>
                <th class="head1">始发仓</th>
                <th class="head1">目的地</th>
                <th class="head1">数量</th>
                <th class="head1">总成本</th>
                
               
              </tr>
            </thead>
            <tbody>
            
           
            <tr>
              <td class="head1">{{$detail.demand_number}}</td>
              <td class="head0">{{$detail.updatetime}}</td>
              <td>
               {{if $detail.status==0}}新创建{{/if}}
        {{if $detail.status==1}}待审核{{/if}}
        {{if $detail.status==2}}一审通过{{/if}}
        {{if $detail.status==3}}二审通过{{/if}}
         {{if $detail.status==4}}关闭{{/if}}
        {{if $detail.status==5}}已完成{{/if}}
        
              </td>
              <td class="center">{{$detail.create_user}}</td>
              <td class="center">{{$detail.shopname}}</td>
              <td class="center">{{$detail.starthouse}}</td>
              <td class="center">{{$detail.seawarehouse}}</td>
              <td class="center">{{$detail.nums}}</td>
                <td class="center">{{$detail.costprice}}</td>
            </tr>
              </tbody>
            
          </table>
        
        
          <div class="contenttitle2">
            <h3>调拨商品</h3>
          </div>
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <colgroup>
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            </colgroup>
            <thead>
              <tr>
              <th class="head0"></th>
                <th class="head0">SKU</th>
                <th class="head1">商品名称</th>
                <th class="head0">重量 KG</th>
                <th class="head0">成本价</th>
                <th class="head0">计划发货数</th>
                 <th class="head0">已发数</th>
                <th class="head0">合计金额</th>
              </tr>
            </thead>
            <tbody>
            
            {{foreach from=$goodsdata item=li key=key}}
            <tr  {{if $li.st==1}}bgcolor="#FFD2D2" title="带商标商品"{{/if}}>
              <td>
              {{if $detail.status==0}}
             <a href="javascript:void(0)" onClick="deleteRquestGoods({{$li.id}},{{$detail.id}})"> <img src="/fuman/images/no.gif"></a>
              {{/if}}
              </td>
               <td>{{$li.goodsno}}</td>
              <td>{{$li.name}}</td>
              <td>{{$li.weight}}</td>
              <td class="center">{{$li.costprice}}</td>
              <td class="center">{{$li.skunum}}</td>
               <td class="center">{{$li.sendnums}}</td>
              <td class="center">{{$li.totalprice}}</td>
          
            </tr>
            {{/foreach}}
              </tbody>
            
          </table>
          
          
          {{if $planning}}
          	 <div class="contenttitle2">
            <h3>运输计划列表</h3>
          </div>
          <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
            <colgroup>
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            <col class="con0" />
            <col class="con1" />
            </colgroup>
            <thead>
              <tr>
              <th class="head0">TP号</th>
               <th class="head0">状态</th>
                <th class="head0">SKU数量</th>
                <th class="head1">总数量	</th>
                <th class="head0">价值</th>
                <th class="head0">目的仓</th>
                <th class="head0">承运人</th>
                 <th class="head0">运输方式</th>
                <th class="head0">创建时间</th>
              </tr>
            </thead>
            <tbody>
            
            {{foreach from=$planning item=li key=key}}
            <tr>
              <td>
             <a href="/oversea/showplandetail/{{$li.id}}"  target="_blank">{{$li.groupid}}</a>
              </td>
              <td>
                 {{if $li.status==1}} 新创建{{/if}}
        {{if $li.status==2}} 一审通过{{/if}}
        {{if $li.status==22}} 一审不通过{{/if}}
       	{{if $li.status==3}} 二审通过{{/if}}
        {{if $li.status==33}} 二审不通过{{/if}}
        	{{if $li.status==4}}已封箱{{/if}}
            {{if $li.status==5}}运输完成{{/if}}
             {{if $li.status==6}}取消计划{{/if}}
             {{if $li.status==8}}已发运{{/if}}
              </td>
               <td>{{$li.skunum}}</td>
              <td>{{$li.totalnum}}</td>
              <td>{{$li.totalamount}}</td>
              <td class="center">{{$li.destination}}</td>
              <td class="center">{{$li.carrier}}</td>
               <td class="center">{{$li.transportmode}}</td>
              <td class="center">{{$li.createtime}}</td>
          
            </tr>
            {{/foreach}}
              </tbody>
            
          </table>
          {{/if}}
          <div class="contenttitle2">
            <h3>合计信息</h3>
          </div>
          <div class="bq2 currentstatus marginbottom0"> SKU数 ：{{$detail.skucount}}个&nbsp;&nbsp;&nbsp;&nbsp;数量: {{$detail.nums}}&nbsp;&nbsp;&nbsp;&nbsp; 金额：{{$detail.costprice}} 
            {{if $detail.boxlistcount>0}} <br>
            箱数：{{$detail.boxlistcount}}箱&nbsp;&nbsp;&nbsp;&nbsp;包装成本 {{$detail.boxlistcos}}&nbsp;&nbsp;&nbsp;&nbsp;
            {{/if}} </div>
            
          
          
          
        
           <div class="bq2 currentstatus marginbottom0"> 
            <input type="hidden" name="groupid" value="{{$detail.groupid}}">
            <input type="hidden" name="transportationplanning_id" value="{{$detail.id}}">
            <!-- <button type="submit" class="submit radius2" id="btn" >编辑</button>--> 
            {{if $detail.status==1 && $firsttrialman ==1}}
            <button type="button" onClick="changstatus(2,{{$detail.id}},1)" class="submit radius2" id="btn" >一审通过</button>
            <button type="button" onClick="askchangstatus(0,{{$detail.id}},1)" class="submit radius2" id="btn" >退回新创建</button>
            {{/if}}
            {{if $detail.status==2 && $secondtrialman ==1}}
            <button type="button" onClick="changstatus(3,{{$detail.id}},1)" class="submit radius2" id="btn" >二审通过</button>
            <button type="button" onClick="askchangstatus(0,{{$detail.id}},1)" class="submit radius2" id="btn" >退回新创建</button>
            {{/if}} 
            
            {{if $detail.status==0}}
            <button type="button" onClick="addgoods({{$detail.id}})" class="btn btn-primary" > 追加SKU </button>
            <button type="button" onClick="getTchangstatus(1,{{$detail.id}})" class="submit radius2" id="btn" >请求一审</button>
            {{/if}} 
            
         
            </div>
        </form>
        <br />
      </div>
      <!--subcontent--> 
      
      <!--subcontent--> 
      
    </div>
    <!--contentwrapper--> 
    
  </div>
  <!-- centercontent --> 
  
</div>

<!--添加退回原因-->
<form  method="post" id="modal_submit" action="#">
            <input type="hidden" name="ist" id="ist">
            <input type="hidden" name="isid" id="isid">
            <input type="hidden" name="istype" id="istype">
        <div class="modal fade" id="backtip" tabindex="-1" role="dialog" aria-labelledby="magentoauth" aria-hidden="true">
            <div class="modal-dialog" style="width:740px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">× </button>
                        <h4 class="modal-title" id="sebayauth">填写退回原因</h4>
                    </div>
                    <div class="modal-body">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td align="right">原因： </td>
                                <td align="left">
                                   <textarea name="back_message"  id="back_message" cols="10" rows=""> </textarea>
                                   </td>
                            </tr>
                        </table>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal"> 关闭 </button>
                            
                            <button type="button" class="btn btn-primary" onClick="actchangstatus()">确定退回</button>
                        </div>
                    </div>
                    <!-- /.modal-content -->
                </div>
                <!-- /.modal-dialog -->
            </div>
        </div>
        <!-- /.modal -->
    </form>

<!-- 模态框（Modal）添加商品 -->
<form action="/oversea/ajaxbutton?op=addorderNewgoods"   method="post" name="otherform" id="otherform" >
<input type="hidden" id="addgoodsorderID" name="addgoodsorderID">
  <div class="modal fade" id="addattributeform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 增加商品 </h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> 商品编号
                <input type="text" name="ordergoodsno[1]" id="ordergoodsno" class="width100" onBlur="getstatusgoods(this)" />
              计划发货数
                <input type="text" name="ordergoodsnoNum[1]" id="ordergoodsnoNum" class="width100" />
               
                <a href="javascript:void(0)"  onClick="showaddgoodsSKU('fileinput')" class="btn btn_book"><span>多增加一商品</span></a></td>
            </tr>
            <tbody id="fileinput">
            </tbody>
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="button" class="btn btn-primary"  onclick="AWS.ajax_post($('#otherform'));$('#addattributeform').modal('hide');"> 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）添加商品 -->

</body>
</html>